{-# LANGUAGE CPP                        #-}
{-# LANGUAGE ForeignFunctionInterface   #-}
{-# OPTIONS -Wall #-}


--------------------------------------------------------------------------------
-- |
-- Module      :  Lambola.Foreign.Java.Functions
-- Copyright   :  (c) Stephen Tetley 2014
-- License     :  BSD3
--
-- Maintainer  :  Stephen Tetley <stephen.tetley@gmail.com>
-- Stability   :  highly unstable
-- Portability :  GHC
--
-- Functions.
--
--------------------------------------------------------------------------------

module Lambola.Foreign.Java.Functions where

#include <jni.h>

import Lambola.Foreign.Java.BasicTypes

import Foreign.C.Types
import Foreign.Ptr ( Ptr )




-- JNI_CreateJavaVM

foreign import ccall unsafe "jni.h JNI_CreateJavaVM"
    jni_CreateJavaVM :: Ptr (Ptr JavaVM) -> Ptr (Ptr v) -> Ptr v -> IO JInt




foreign import ccall unsafe "jni.h GetVersion"
    getVersion :: Ptr JNIEnv -> IO JInt

{-
foreign import ccall unsafe "jni.h DefineClass"
    defineClass :: Ptr JNIEnv -> Ptr CChar -> JObject -> Ptr JByte -> JSize 
                -> IO JClass


foreign import ccall unsafe "jni.h FindClass"
    findClass :: Ptr JNIEnv -> Ptr CChar -> IO JClass



-- ExceptionClear

foreign import ccall unsafe "jni.h ExceptionClear"
    exceptionClear :: Ptr JNIEnv -> IO ()


-- ExceptionDescribe

foreign import ccall unsafe "jni.h ExceptionDescribe"
    exceptionDescribe :: Ptr JNIEnv -> IO ()


-- ExceptionOccurred

foreign import ccall unsafe "jni.h ExceptionOccurred"
    exceptionOccurred :: Ptr JNIEnv -> IO JThrowable


-- FatalError

foreign import ccall unsafe "jni.h FatalError"
    fatalError :: Ptr JNIEnv -> Ptr CChar -> IO ()



foreign import ccall unsafe "jni.h ExceptionCheck"
    exceptionCheck :: Ptr JNIEnv -> IO JBoolean

-}